<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="laundryRequest.title"/></title>
    <meta name="heading" content="<fmt:message key='laundryRequest.heading'/>"/>
    <meta name="menu" content="RoleAdminLaundry"/>

    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/lang/calendar-es.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>"></script>

    <script type="text/javascript">
        window.onload = function() {
            Calendar.setup({
                inputField: "dateLaundryID",
                ifFormat: "%d/%m/%Y",
                button: "dateLaundryID"
            });
        }        
    </script>
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helpLaundryRequestForm.html?decorate=false'/>"
           title="Help laundry request form"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
            <fmt:message key="help"/>
        </a>
    </h2>
</div>
<s:form id="laundryRequestForm" action="saveLaundryRequest" method="post" validate="true">
    <s:hidden key="laundryRequest.id" cssClass="text medium"/>
    <table border="0">
        <tbody>
            <tr>
                <td>
                    <s:select key="laundries" list="laundries" name="laundryRequest.laundry.id" listKey="id" listValue="name"
                              headerKey="-1" headerValue="- Select please -" />
                </td>
                <td>
                    <s:select key="coins" list="coins" name="laundryRequest.coin.id" listKey="id" listValue='name'
                              headerKey="-1" headerValue="- Select please -" />
                </td>
                <td>
                    <s:textfield key="dateLaundry" id="dateLaundryID" required="true" cssClass="text medium"/>
                </td>
            </tr>           
            <tr>
                <td>
                    <s:select key="tradeMarks" list="tradeMarks" name="laundryRequest.tradeMark.id" listKey="id" listValue="name"
                    headerKey="-1" headerValue="- Select please -" />
                </td>
                <td>
                    <s:select key="sizeRanks" list="sizeRanks" name="laundryRequest.sizeRank.id" listKey="id" listValue='name'
                    headerKey="-1" headerValue="- Select please -" />
                </td>
                <td>
                    <!-- s:textfield key="receivedDate" id="receivedDateID" cssClass="text medium"/ -->
                </td>
        </tr></tbody>
    </table>

    <li class="buttonBar bottom">
        <s:submit cssClass="button" method="save" key="button.save" theme="simple"/>
        <c:if test="${not empty laundryRequest.id}">
            <s:submit cssClass="button" method="delete" key="button.delete" onclick="return confirmDelete('loundryRequest')" theme="simple"/>
        </c:if>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
    </li>
</s:form>

<script type="text/javascript">
    Form.focusFirstElement($("laundryRequestForm"));
</script>